6ea7f5d26b622c0cd2ff31a2cfb2effd331ebafe,clc/modules/walrus/src/main/java/edu/ucsb/eucalyptus/cloud/ws/WalrusManager.java,WalrusManager,putObject,#PutObjectType#,559
Before Change
foundObject.setLastModified(lastModified);
foundObject.setStorageClass("STANDARD");
foundObject.setContentType(request.getContentType());
foundObject.setContentDisposition(request.getContentDisposition());
reply.setSize(size);
if(WalrusProperties.shouldEnforceUsageLimits && !request.isAdministrator()) {
Long bucketSize = bucket.getBucketSize();
After Change
searchObject = new ObjectInfo(bucketName, objectKey);
ObjectInfo foundObject;
try {
foundObject = dbObject.getUnique(searchObject);
if (foundObject.canWriteACP(userId)) {
List<GrantInfo> grantInfos = new ArrayList<GrantInfo>();
foundObject.addGrants(userId, grantInfos,
accessControlList);
foundObject.setGrants(grantInfos);
}
oldObjectSize = foundObject.getSize();
if(WalrusProperties.enableTorrents) {
EntityWrapper<TorrentInfo> dbTorrent = db.recast(TorrentInfo.class);
TorrentInfo torrentInfo = new TorrentInfo(bucketName, objectKey);
List<TorrentInfo> torrentInfos = dbTorrent.query(torrentInfo);
if(torrentInfos.size() > 0) {
TorrentInfo foundTorrentInfo = torrentInfos.get(0);
TorrentClient torrentClient = Torrents.getClient(bucketName + objectKey);
if(torrentClient != null) {
torrentClient.bye();
}
dbTorrent.delete(foundTorrentInfo);
}
} else {
LOG.warn("Bittorrent support has been disabled. Please check pre-requisites");
}
} catch (EucalyptusCloudException ex) {
if(objectInfo != null) {
foundObject = objectInfo;
} else {
db.rollback();
throw new EucalyptusCloudException("Unable to update object: " + bucketName + "/" + objectKey);
}
}
foundObject.setEtag(md5);
foundObject.replaceMetaData(request.getMetaData());
foundObject.setSize(size);
foundObject.setLastModified(lastModified);
foundObject.setStorageClass("STANDARD");
foundObject.setContentType(request.getContentType());
foundObject.setContentDisposition(request.getContentDisposition());
reply.setSize(size);
if(WalrusProperties.shouldEnforceUsageLimits && !request.isAdministrator()) {
Long bucketSize = bucket.getBucketSize();